<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script type="text/JavaScript">
      /*
          从键盘接受整数参数,如果该数为1-7,打印对应的星期,否则打印非法参数;

        //    =是赋值运算符,==比较运算符
      */
          var num = prompt("请输入数字");
               num = Number(num);
            alert(typeof num);
              switch (num) {
                  case 1:
                          alert("今天是星期一");
                      break;
                  case 2:
                          alert("今天是星期二");
                      break;
                  case 3:
                          alert("今天是星期三");
                      break;
                  case 4:
                          alert("今天是星期四");
                      break;
                  case 5:
                          alert("今天是星期五");
                      break;
                  case 6:
                          alert("今天是星期六");
                      break;
                  case 7:
                          alert("今天是星期日");
                      break;
                  default:
                          alert("非法参数");
                      break;
              }
    </script>
  </head>
  <body></body>
</html>
